<?php
defined('BASEPATH') or exit('No direct script access allowed');
require APPPATH.'libraries/BaseApiController.php';
class basic extends  BaseApiController
{
   public function index(){
   }
   
   public function info(){
	   $token=$this->verifyToken();
	   if($token){
			$row=$this->db->where("schcode",$token["schcode"])->get("school")->row_array();
			if($row){
				$this->WRITE("data",$row);
				$this->WRITE("code",1);
				$this->WRITE("msg","success");
				$this->RESPONSE();
			}else{
				$this->WRITE("code",0);
				$this->WRITE("msg","success");
				$this->RESPONSE();
			}
		}
   }
   
   public function update(){
	   $token=123;//$this->verifyToken();
	   if($token){
		  if($this->checkKeys("ogcode,title")){
			  $data=$this->getKeys("ogcode,title,mobile,master,address,desc");
			  $res=$this->db->where("ogcode",$data["ogcode"])->update("organization",$data);
			  if($res){
				  $this->WRITE("msg","保存成功!");
				  $this->WRITE("code",1);
				  $this->RESPONSE();
			  }else{
				  $this->WRITE("msg","保存失败!");
				  $this->WRITE("code",0);
				  $this->RESPONSE();
			  }
		  }
	   }
   }
   
}